package com.blb.order_service.feign;

import com.blb.order_service.entity.Goods;
import com.blb.order_service.entity.JsonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 测试各种参数的传递
 */
@FeignClient(value = "goods-service",path = "/test")
public interface RestTestFeignClient {

    @GetMapping
    JsonResult testGet();

    @GetMapping("/{id}")
    JsonResult testGetOne(@PathVariable("id")Long id);

    @PostMapping("post")
    JsonResult testPost(@RequestBody Goods goods);

    @PostMapping("post2")
    JsonResult testPost2(Goods goods);

    @PostMapping("login")
    JsonResult login(@RequestParam String username,@RequestParam String password);

    @PutMapping
    JsonResult testPut(@RequestBody Goods goods);

    @DeleteMapping("{id}")
    JsonResult testDelete(@PathVariable("id")Long id);
}
